﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Collections.Generic;
using System.Data.SqlClient;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;

public partial class ProductDetail : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        BZZ.DataAcess worker = new BZZ.DataAcess();
        string id = Request.QueryString["id"];
        try
        {
            Convert.ToInt32(id);
        }
        catch
        {
            LIB.JsWrite.AlertAndGoback(this, "非法的参数。");
        }
        string sql = "select * from product where id=" + id;
        DataSet dset = worker.Execute(sql);
        if (dset != null && dset.Tables[0].Rows.Count > 0)
        {
            DataRow row = dset.Tables[0].Rows[0];
            string varid = row["id"].ToString().Trim();
            string varPicURL = row["picURL"].ToString().Trim();//图片地址
            string varProductCode = row["productCode"].ToString().Trim();//作品编号
            string varProfessorID = row["professorID"].ToString().Trim();//作者姓名
            string varTitle = row["title"].ToString().Trim();//作品名称
            string varMaterial = row["material"].ToString().Trim();//作品材质
            string varSize = row["size"].ToString().Trim();//作品规格
            string varPrice = row["price"].ToString().Trim();//作品标价
            string varSale = row["sale"].ToString().Trim();//销售情况
            string varAbout = row["about"].ToString().Trim();//作品介绍
            string varMemo = row["memo"].ToString().Trim();//备注信息
            string varPubDate = row["pubDate"].ToString().Trim();//添加时间
            string varSortid = row["sortid"].ToString().Trim();//排序
            string varIsRecommend = row["isRecommend"].ToString().Trim();//是否推荐
            varPicURL = "img/" + varPicURL;
            //imgProduct.Src = varPicURL.Replace("Thumb/", "");
            string orgPicurl = varPicURL.Replace("thumb/", "");
            //if (imgProduct.Width > 876) imgProduct.Width = 876;
            System.Text.StringBuilder sb2 = new System.Text.StringBuilder();
            sb2.Append("<div class=\"thumbnail\">");
            sb2.Append("    <a rel=\"lightbox\" href=\""+varPicURL+"\">");
            sb2.Append("    </a>");
            sb2.Append("    <a rel=\"lightbox\" href=\"" + varPicURL + "\" title=\"\">");
            sb2.Append("        <img id='pic1' src=\"" + varPicURL + "\"  onload=\"javascript:DrawImage2(this);\"");
            sb2.Append("        border=\"0\" style=\"border:3px solid #EEE\">");
            sb2.Append("    </a>");
            sb2.Append("</div>");
            litPicShow.Text = sb2.ToString();

            System.Text.StringBuilder sb=new System.Text.StringBuilder();
            sb.Append("            <table width=\"232\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" class=\"zt07\">");
            sb.Append("                  <tr>");
            sb.Append("                    <td  align=\"right\"  >&nbsp;编号：</td>");
            sb.Append("                    <td width=\"142\" align=\"left\">" + varProductCode + " </td>");
            sb.Append("                  </tr>");
            sb.Append("                  <tr>");
            sb.Append("                    <td align=\"right\"  >&nbsp;品名：</td>");
            sb.Append("                    <td align=\"left\">" + varTitle + "</td>");
            sb.Append("                  </tr>");
            sb.Append("                  <tr>");
            sb.Append("                    <td align=\"right\"  >&nbsp;规格：</td>");
            sb.Append("                    <td align=\"left\">" + varSize + "</td>");
            sb.Append("                  </tr>");
            sb.Append("                  <tr>");
            sb.Append("                    <td align=\"right\"  >&nbsp;售价：</td>");
            sb.Append("                    <td align=\"left\">" + varPrice + "</td>");
            sb.Append("                  </tr>");
            sb.Append("                  <tr>");
            sb.Append("                    <td align=\"right\"  >&nbsp;状态：</td>");
            sb.Append("                    <td align=\"left\">" + varSale + "</td>");
            sb.Append("                  </tr>");

            sb.Append("                </table>");
            litDetail.Text = sb.ToString();
        }
    }
}
